<%@page import="java.security.SecureRandom"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<base href="<%=basePath%>">
<title>用户管理</title>
<!-- script  -->
<script language="javascript" src="/huahua/resources/js/city.js"></script>
<!-- Favicon  -->
<link rel="icon" href="/huahua/resources/images/core-img/favicon.ico">

<!-- Core Style CSS -->
<link rel="stylesheet" href="/huahua/resources/css/core-style.css">
<script type="text/javascript"
	src="resources/js/jquery/jquery-2.2.4.min.js"></script>
<script>
	//页面加载   获取全部信息
	$(function() {
		$.ajax({
			type : "POST",//请求方式
			url : "http://localhost:8080/huahua//admin/selectAll.shtml",
			dataType : "json",
			success : function(result) {
				addBox(result);
				addTb(result);
			}
		});
	});
	function addBox(result) {
		//result是一个集合,所以需要先遍历
		$.each(result, function(index, obj) {
			$("#box").append("<div class='user'>" +
			//获得名字
			"<div class='p1 p'>" + obj['userId'] + "</div>" +
			//获得性别
			"<div class='p2 p'>" + obj['userName'] + "</div>" +
			//获得邮箱地址
			"<div class='p3 p'>" + obj['password'] + "</div>" +

			"</div>");
		});
	}

	function addTb(result) {
		var tb = document.getElementById("tb");
		for (var i = 0; i < result.length; i++) {

			var row = tb.insertRow(tb.rows.length);
			var c1 = row.insertCell(0);
			c1.innerHTML = result[i].userId;
			var c2 = row.insertCell(1);
			c2.innerHTML = result[i].userName;
			var c3 = row.insertCell(2);
			c3.innerHTML = result[i].password;
			var c4 = row.insertCell(3);
			c4.innerHTML = result[i].address;
			var c5 = row.insertCell(4);
			c5.innerHTML = result[i].tele;
			var c6 = row.insertCell(5);
			c6.innerHTML = result[i].deposit;

			var c7 = row.insertCell(6);
			c7.innerHTML = '<a href=http://localhost:8080/huahua//admin/adminUpdate.shtml?id='

	+ result[i].userId
					+ '>修改</a>/<a href=http://localhost:8080/huahua//admin/deleteByPrimaryKey.shtml?id='
					+ result[i].userId + '>删除</a>';
		}
	}
</script>



</head>
<body>
	<!-- ##### Header Area Start ##### -->
	<header class="header_area">
		<div
			class="classy-nav-container breakpoint-off d-flex align-items-center justify-content-between">
			<!-- Classy Menu -->
			<nav class="classy-navbar" id="essenceNav">
				<!-- Logo -->
				<a class="nav-brand" href="index.jsp"><img
					src="/huahua/resources/images/core-img/logo.png" alt=""></a>
				<!-- Navbar Toggler -->
				<div class="classy-navbar-toggler">
					<span class="navbarToggler"><span></span><span></span><span></span></span>
				</div>
				<!-- Menu -->
				<div class="classy-menu">
					<!-- close btn -->
					<div class="classycloseIcon">
						<div class="cross-wrap">
							<span class="top"></span><span class="bottom"></span>
						</div>
					</div>
					<div class="classynav">
						<ul>
							<li><a
								href="http://localhost:8080/huahua//good/getPaged.shtml?pageNum=1">Shop</a></li>


							<li><a
								href="http://localhost:8080/huahua/pages/front/adminHome.jsp">MyHome</a></li>
						</ul>
					</div>
				</div>
			</nav>
			<!-- Header Meta Data -->
			<div class="header-meta d-flex clearfix justify-content-end">

				<!-- Favourite Area -->
				<div class="favourite-area">
					<a href="<%=basePath%>/user/logout.shtml">退出登录</a>
				</div>


			</div>

		</div>
	</header>
	<!-- ##### Header Area End ##### -->







	<!-- ##### Blog Wrapper Area Start ##### -->
	<div class="single-blog-wrapper">

		<!-- Single Blog Post Thumb -->
		<div class="breadcumb_area breadcumb-style-two bg-img"
			style="background-image: url(/huahua/resources/images/bg-img/blog4.jpg);">
			<div class="container h-100">
				<div class="row h-100 align-items-center">
					<div class="col-12">
						<div class="page-title text-center">
							<h2>用 户 管 理</h2>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!-- Single Blog Content Wrap -->
		<div class="single-blog-content-wrapper d-flex">
			<!-- Blog Content -->
			<div class="single-blog--text">




				<div class="table">
					<table class="table" id="tb" width="500px">
						<thead>
							<tr>
								<td>ID</td>
								<td>用户名</td>
								<td>密码</td>
								<td>邮箱</td>
								<td>电话</td>
								<td>押金</td>
								<td>操作</td>
							</tr>
						</thead>

					</table>
				</div>

			


			</div>
			<!-- Related Blog Post -->
	<div class="related-blog-post">
				<!-- Single Related Blog Post -->
				<div class="single-related-blog-post">
					<img src="/huahua/resources/images/bg-img/rp1.jpg" alt=""> <a
						href="http://localhost:8080/huahua/pages/admin/user_manage.jsp">
						<h5>用户信息</h5>
					</a>
				</div>
				<div class="single-related-blog-post">
					<img src="/huahua/resources/images/bg-img/rp2.jpg" alt=""> <a
						href="http://localhost:8080/huahua/pages/front/checkmoney.jsp">
						<h5>余额审核</h5>
					</a>
				</div>
			
		<div class="single-related-blog-post">
					<img src="/huahua/resources/images/bg-img/rp3.jpg" alt=""> <a
						href="http://localhost:8080/huahua/pages/front/checkreturn.jsp">
						<h5>归还审核</h5>
					</a>
				</div>
			<!-- Single Related Blog Post -->
				<div class="single-related-blog-post">
					<img src="/huahua/resources/images/bg-img/rp1.jpg" alt=""> <a
						href="http://localhost:8080/huahua/pages/front/addexpressnum.jsp">
						<h5>填写单号</h5>
					</a>
				</div>
				<!-- Single Related Blog Post -->
				<div class="single-related-blog-post">
					<img src="/huahua/resources/images/bg-img/rp4.jpg" alt=""> <a
						href="http://localhost:8080/huahua/pages/front/adminHome.jsp">
						<h5>返回主页</h5>
					</a>
				</div>
			</div>
		</div>
	</div>

	<!-- ##### Blog Wrapper Area End ##### -->

	<!-- ##### Footer Area Start ##### -->
	<footer class="footer_area clearfix"> </footer>
	<!-- ##### Footer Area End ##### -->
	<!-- jQuery (Necessary for All JavaScript Plugins) -->
	<script src="/huahua/resources/js/jquery/jquery-2.2.4.min.js"></script>
	<!-- Popper js -->
	<script src="/huahua/resources/js/popper.min.js"></script>
	<!-- Bootstrap js -->
	<script src="/huahua/resources/js/bootstrap.min.js"></script>
	<!-- Plugins js -->
	<script src="/huahua/resources/js/plugins.js"></script>
	<!-- Classy Nav js -->
	<script src="/huahua/resources/js/classy-nav.min.js"></script>
	<!-- Active js -->
	<script src="/huahua/resources/js/active.js"></script>
</body>
</html>